package com.tma.demo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity implements OnClickListener {
    private Button mBadButton;
    private Button mGoodButton;
    private Button mSlideshowButton;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mBadButton = (Button) findViewById(R.id.btn_bad);
        mGoodButton = (Button) findViewById(R.id.btn_good);
        mSlideshowButton = (Button) findViewById(R.id.btn_slideshow);

        mBadButton.setOnClickListener(this);
        mGoodButton.setOnClickListener(this);
        mSlideshowButton.setOnClickListener(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    public void onClick(View v) {
        Intent i;
        switch (v.getId()) {
        case R.id.btn_bad:
            i = new Intent(this, BadActivity.class);
            startActivity(i);
            break;
        case R.id.btn_good:
            i = new Intent(this, GoodActivity.class);
            startActivity(i);
            break;
        case R.id.btn_slideshow:
            i = new Intent(this, SlideShowActivity.class);
            startActivity(i);
            break;
        default:
            break;
        }
    }

}
